import request from '@/utils/request.js'
import { useTokenStore } from '@/stores/token.js'

//通过e_id查询该场考试的考生列表
export const studentListByExamIdService = (e_id)=>{
    //const tokenStore = useTokenStore();
    //在pinia中定义的响应式数据,都不需要.value
    //return request.get('/student',{headers:{'Authorization':tokenStore.token}})
    return request.get('/studentlist',e_id)
}

//考生搜索
export const studentSearchService = (studentData)=>{
    return request.get('/student',studentData)
}

//考生添加
export const studentAddService = (studentData)=>{
    return request.post('/student',studentData)
}

//通过excel文件批量考生添加
export const studentBatchAddService = (studentData)=>{
    return request.post('/student',studentData)
}

//考生信息修改
export const studentUpdateService = (studentData)=>{
   return  request.put('/student',studentData)
}

//考生删除
export const studentDeleteService = (id)=>{
    return request.delete('/student?id='+id)
}


// 考生操作：提交答卷
// const submitExamData = ref({
//     s_id: my_s_id.value,  // 本人学号
//     e_id: null,           // 考试的id
//     e_name: '',           // 考试名称
//     s_fpath: '',          // 答卷的下载路径
//     s_fname: '',          // 答卷的名称
// })
export const studentSubmitExamService = (submitExamData)=>{
    return request.put('/student/SubmitExam',submitExamData)
}

